from flask import jsonify, current_app

from src.http.example import BlueprintHttpExample
from src.const.code import Code
from src.util.rs import Rs
from src.util.function import app_path, src_path, static_path


@BlueprintHttpExample.route('/logging')
def logging():
    current_app.logger.info("项目根目录: %s", app_path())
    current_app.logger.warning("项目src目录: %s", src_path())
    current_app.logger.error("项目static目录: %s", static_path())
    return jsonify(Rs(
        Code.OK,
        Code.message(Code.OK),
    ).to_dict())
